import {print} from 'nc-lightapp-front';
import handleAllpks from "./handleAllpks";
/*
    6007401001:集团节点不包含解除
    6007401002:集团节点包含解除
    6007402001:组织节点不包含解除
    6007402002:组织节点包含解除
    */
export default function templatePrint() {
    const {nodetype, includeCheckedPsn, editTable} = this.props;

    //const selectedData = editTable.getAllRows('blacklist');
    //const param_str = selectedData.map(item => item.values.pk_psndoc_bad.value);
    const param_str = handleAllpks.get();
    const funcode = nodetype === 'GROUP_NODE' ? '60074010' : '60074020';
    const nodekey = funcode + (includeCheckedPsn ? '02' : '01');

    let postData = {
        funcode,     //功能节点编码，即模板编码
        nodekey,
        oids: param_str   // 单据pk  oids含有多个元素时为批量打印,
    };

    print(
        'pdf',  //支持两类: 'html'为模板打印, 'pdf'为pdf打印
        '/nccloud/hrhi/blacklist/BlackListPrintAction.do',
        postData
    );
}
